<template>
  <div class="banner" @click='handleBannerClick()'>
    <img class="banner-img" :src='this.bannerImg' alt="">
    <div class="banner-info">
      <div class="banner-tittle">{{this.sightName}}</div>
      <div class="banner-number">
        <span class="iconfont">&#xe678;</span>
        {{this.gallaryImgs.length}}
      </div>
    </div>
    <fade-animation>
      <gallary
        :gallaryImgs='this.gallaryImgs'
        v-show='showGallary'
        @close='handleGallaryClose'
      ></gallary>
    </fade-animation>
  </div>
</template>

<script>
import gallary from 'common/gallary/gallary'
import FadeAnimation from 'common/fade/fadeAnimation'
export default {
  name: 'detailBanner',
  props: {
    sightName: String,
    bannerImg: String,
    gallaryImgs: Array
  },
  components: {
    gallary,
    FadeAnimation
  },
  data () {
    return {
      showGallary: false
      // imgsUrl: [
      //   'http://img1.qunarzz.com/sight/p0/1409/19/adca619faaab0898245dc4ec482b5722.jpg_r_800x800_6edd8174.jpg',
      //   'http://img1.qunarzz.com/sight/p55/201211/04/fbcab3e5d6479ce893835fbb.jpg_r_800x800_6360f514.jpg',
      //   'http://img1.qunarzz.com/wugc/p180/201306/16/7f08e81624346b1693835fbb.jpg_r_800x800_5f03ad73.jpg'
      // ]
    }
  },
  methods: {
    handleBannerClick () {
      this.showGallary = true
    },
    handleGallaryClose () {
      this.showGallary = false
    }
  }
}
</script>

<style lang= 'stylus' scoped>
.banner
  position: relative
  height: 0
  padding-bottom: 55%
  .banner-img
    width: 100%
  .banner-info
    position: absolute
    left: 0
    bottom: 0
    right: 0
    display: flex
    height: .6rem
    background-image: linear-gradient(to bottom,rgba(0 , 0 , 0, 0),rgba(0, 0, 0, 0.8))
    .banner-tittle
      flex: 1
      height: 100%
      line-height: .6rem
      color: #fff
      padding-left: .2rem
    .banner-number
      color: #fff
      padding: 0 .4rem
      margin-top: .14rem
</style>
